﻿<%@ Page Title="Product" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="Product.aspx.cs" Inherits="Admin_Product" %>
<%@ Register src="../Controls/Pager.ascx" tagname="Pager" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <div class="title">Product</div>
    <div class="toolbar">
        <input type="button" value="Add new product"
        onclick="location.href='EditProduct.aspx'"/>
            <asp:Button Text="Delete selected" runat="server" ID="btnDelete"
            CssClass="multidelete"/>
    </div>
    <uc1:Pager ID="pagerTop" runat="server" />
        <table class="list">
            <thead>
                <tr>
                    <th class="cid"><input type="checkbox" id="chkAll" /></th>
                    <th>Name</th>
                    <th class="small">Price</th>
                    <th class="small">Valid</th>
                    <th class="id">ID</th>
                </tr>
            </thead>
            <asp:Repeater runat="server" ID="repProd">
                <AlternatingItemTemplate>
                    <tr class="even">
                        <td><input type="checkbox" name='cid'
                        value='<%#Eval("MaHangHoa") %>' /></td>
                        <td class="link"> 
                        <a href='EditProduct.aspx?cid=<%#Eval("MaHangHoa") %>'>
                        <%#Eval("TenHangHoa")%>
                        </a>
                        </td>
                        <td><%#Eval("GiaMua")%></td>
                        <td><asp:LinkButton ID="LinkButton1" runat="server" Text='<%#Eval("TrangThai")%>'
                            CommandName="UpdatePromo"
                            CommandArgument='<%#Eval("MaHangHoa") + "_" + Eval("TrangThai")%>'/> 
                        </td>
                        <td class="id"><%#Eval("MaHangHoa")%></td>
                    </tr>
                </AlternatingItemTemplate>
                <ItemTemplate>
                    <tr>
                        <td><input type="checkbox" name='cid'
                        value='<%#Eval("MaHangHoa") %>' /></td>
                        <td class="link">
                            <a href='EditProduct.aspx?cid=<%#Eval("MaHangHoa") %>'>
                            <%#Eval("TenHangHoa")%>
                            </a>
                        </td>
                        <td><%#Eval("GiaMua")%></td>
                        <td><asp:LinkButton ID="LinkButton1" runat="server" Text='<%#Eval("TrangThai")%>'
                            CommandName="UpdatePromo"
                            CommandArgument='<%#Eval("MaHangHoa") + "_" + Eval("TrangThai")%>'/> 
                        </td>
                        <td class="id"><%#Eval("MaHangHoa")%></td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </table>
    <uc1:Pager ID="pagerBottom" runat="server" />
</asp:Content>


